package com.app.micaihu.bean.comment;

import com.app.micaihu.R;
import com.app.micaihu.app.AppApplication;

import java.util.List;

/**
 * Created by Guo on 2016/12/18.
 *
 *
 * 普通评论的网络接受类
 *
 * 带有热门评论和最新评论
 */

public class CommentList1 {
    private List<NormalComment> hotCmtList;//热门评论
    private List<NormalComment> normalCmtList;//最新评论


    public List<NormalComment> getHotCmtList() {
        return hotCmtList;
    }

    public void setHotCmtList(List<NormalComment> hotCmtList) {
        this.hotCmtList = hotCmtList;
    }

    public List<NormalComment> getNormalCmtList() {
        return normalCmtList;
    }

    public void setNormalCmtList(List<NormalComment> normalCmtList) {
        this.normalCmtList = normalCmtList;
    }

    /**
     * 得到所有评论
     * @return
     */
    public List<NormalComment> getAllCommentList(){
        if(hotCmtList != null && hotCmtList.size() > 0){
            //在第一个位置添加热门评论
            NormalComment comment = new NormalComment();
            comment.setCommentTitle(AppApplication.getInstance().getString(R.string.speak_title_hot));
            hotCmtList.add(0,comment);
        }
        if(normalCmtList != null && normalCmtList.size() > 0){
            //在第一个位置添加最新评论
            NormalComment comment = new NormalComment();
            comment.setCommentTitle(AppApplication.getInstance().getString(R.string.speak_title_new));
            normalCmtList.add(0,comment);
        }
        //拼接两组评论
        if(hotCmtList != null){
            hotCmtList.addAll(normalCmtList);
        }
        return hotCmtList;
    }
}
